<template>
  <div>
    <f-form ref='form' :action='api.policy' :form-key='this.formItem.policyFileId'>
      <f-form-item label='结束日期' type='date' name='endDate' :value='formItem.endDate' />
      <f-form-item label='备注' name='remark' :value='formItem.remark' />
    </f-form>
  </div>
</template>
<script>
import api from "../../../js/api"

export default {
  name: "PolicyEndForm",
  props: {},
  data() {
    let me = this
    return {
      refs: this.$refs,
      api: Object.assign(api, this.api),
      isAdd: true,//是否是添加模式
      drawerVisible: false,
      loaded: false,//是否加载完成
      formItem: this.getFormItem()
    }
  },
  methods: {
    getFormItem() {
      return {
        policyFileId: "",
        endDate: null,
        remark: ""
      }
    },
    visibleChange(drawerVisible) {
      this.drawerVisible = drawerVisible
    },
    //表单赋值
    setData(data) {
      this.$refs.form.resetFields()
      this.formItem = data
      if (data && data.consumptionId) {
        this.isAdd = false
      } else {
        this.loaded = true
      }
    },
    //提交表单
    handleSubmit(callback) {
      this.$refs.form.submit({}, callback)
    }
  },
  created() {
  },
  components: {}
}
</script>

<style scoped lang='less' rel='stylesheet/less'>

</style>
